<%--
  Created by IntelliJ IDEA.
  User: TT
  Date: 2020/10/21
  Time: 20:03
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <script type="text/javascript" src="js/jquery-1.8.2.min.js"></script>
    <link rel="stylesheet" href="css/index2.css">
    <script type="text/javascript">
        $(function () {
            $.post("idlist",{"sid":${param.sid}},function (number) {
                $("[name=sno]").val(number.sno);
                $("[name=sname]").val(number.sname);
                $("[name=sex][value='"+number.sex+"']").prop("checked",true);
                $("[name=birthday]").val(number.birthday);
                $("[name=category]").val(number.category);
                $("[name=subject]").val(number.subject);
                $("[name=school]").val(number.school);

                $.post("huixian",function (num){
                    for (var i in num){
                        if (number.cid==num[i].cid){
                            $("#f").append("<option value='"+num[i].cid+"' selected>"+num[i].cname+"</option>");
                        }else{
                            $("#f").append("<option value='"+num[i].cid+"'>"+num[i].cname+"</option>");
                        }

                    }
                },"json");
                // alert(number.cid)
                // $("[name=cid]").val(number.cid);
            },"json");
        })
    </script>
</head>
<body>
<form action="update" method="post">
    <input type="hidden" name="sid" value="${param.sid}"><br>
    学生学号:<input type="text" name="sno"><br>
    学生姓名:<input type="text" name="sname"><br>
    学生性别:<input type="radio" name="sex" value="男">男
    <input type="radio" name="sex" value="女">女<br>
    出生日期:<input type="date" name="birthday"><br>
    类别:<select name="category">
    <option value="城市应届">城市应届</option>
    <option value="农村应届">农村应届</option>
</select><br>
    学科:<select name="subject">
    <option value="理工">理工</option>
    <option value="文史">文史</option>
</select><br>
    所在学校:<input type="text" name="school"><Br>
    加分类型:<select id="f" name="cid">
    <option value="">请选择</option>
</select><br>
    <input type="submit" name="提交">
</form>
</body>
</html>
